import java.util.HashSet;
import java.util.Scanner;

public class Main7 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string1 = scanner.nextLine();
        String string2 = scanner.nextLine();
        HashSet<Character> hashSet = new HashSet<>();
        for (int i = 0; i < string2.length(); i++) {
            hashSet.add(string2.charAt(i));
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < string1.length(); i++) {
            char c = string1.charAt(i);
            if (!hashSet.contains(c)) {
                stringBuilder.append(c);
            }
        }
        System.out.println(stringBuilder);
    }
}



